package com.hunt.util;

public  enum SeasonEnum {
    SPRING("0331", 1), SUMMER("0630", 2), AUTUMN("0930", 3), WINTER("1231", 4);
    private String time;
    private int index;
    private SeasonEnum(String time, int index) {
        this.time = time;
        this.index = index;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public static int getSeason(String time) {
        for (SeasonEnum s : SeasonEnum.values()) {
            if (s.getTime().equals(time)) {
                return s.index;
            }
        }
        return 0;
    }

}